<div class="detailsBox">
       <h3 class="mt20"><i class="jtIco"></i> 总部归档</h3>
       <div class="cktitle" style="margin-top:10px;"><span class="xiala"></span>平台寄送资料清单核对</div>
       <div id="platformDiv" class="m10 detaiTab" style="border-right:1px solid #e1e1e1; border-left:1px solid #e1e1e1">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="b_t_e5">
                    <tbody>
                    	<#list 0..(platformFields?size/3)?ceiling-1 as x> 
                    	 	<tr>
                    	 		<#list 0..2 as index> 
	                    	 		<#if platformFields[x*3+index]??>
			                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>${platformFields[x*3+index].fieldName}</td>
			                            <td class="fieldVaule" data="${platformFields[x*3+index].fieldName}">
			                            <select>
			                            	<option>请选择</option>
			                            	<#list platformFields[x*3+index].fieldMin..platformFields[x*3+index].fieldMax as i> 
			                            		<#if platformFields[x*3+index].fieldValue?? && platformFields[x*3+index].fieldValue ==i >
			                            			<option selected="selected">${i}</option>
			                            		<#else>
			                            			<option>${i}</option>
			                            		</#if>
			                            	</#list>
			                            </select>
			                                                       份</td>
	                    	 		<#else>
	                    	 			<td align="right" class="bg" width="15%"></td>
			                            <td></td>
	                    	 		</#if>
                    	 		</#list>
	                        </tr>
						</#list>
						 <tr>
                            <td align="right" class="bg " width="15%">快递寄送凭证</td>
                            <td> <div class="openBox action-ajax-load" data-url="<@url value='/archive/rest/v1/fileDiv?loanapplyNo=${loanapplyNo}&loanId=${loanId}&datalistType=FASTFREIGHT&hidenBtn=true'/>" id="file_uploader"> </div></td>
                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>快递时间</td>
                            <td colspan="3">
								<@date value="${platformRecord.sendTime}" name="sendTime"  data\-action\-valid\-rule="required;"/>
							    <span class="action-field-error" for="loanDate" style="color:red;"></span>
							</td>
                        </tr>
                        <tr>
                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>快递公司</td>
                            <td> <input name="sendCompany" type="text" value="${platformRecord.sendCompany}" /></td>
                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>快递单号</td>
                            <td colspan="3"> <input name="sendNo" type="text" value="${platformRecord.sendNo}" /></td>
                        </tr>
                    </tbody>
                </table> 
            </div>
            
            <form id="archiveRecordForm" action="/archive/rest/v1/saveArchiveRecord" class="action-ajax-form" method="post">
            <div class="cktitle" style="margin-top:10px;"><span class="xiala"></span>省区寄送总部归档资料清单</div>
      		 <div class="m10 detaiTab" style="border-right:1px solid #e1e1e1; border-left:1px solid #e1e1e1">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="b_t_e5">
                    <tbody>
                    	<#list 0..(provinceFields?size/3)?ceiling-1 as x> 
                    	 	<tr>
                    	 		<#list 0..2 as index> 
	                    	 		<#if provinceFields[x*3+index]??>
			                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>${provinceFields[x*3+index].fieldName}</td>
			                            <td class="fieldVaule" data="${provinceFields[x*3+index].fieldName}">
			                            <select>
			                            	<option>请选择</option>
			                            	<#list provinceFields[x*3+index].fieldMin..provinceFields[x*3+index].fieldMax as i> 
			                            		<#if provinceFields[x*3+index].fieldValue?? && provinceFields[x*3+index].fieldValue ==i >
			                            			<option selected="selected">${i}</option>
			                            		<#else>
			                            			<option>${i}</option>
			                            		</#if>
			                            	</#list>
			                            </select>
			                                                       份</td>
	                    	 		<#else>
	                    	 			<td align="right" class="bg" width="15%"></td>
			                            <td></td>
	                    	 		</#if>
                    	 		</#list>
	                        </tr>
						</#list>
						 <tr>
                            <td align="right" class="bg " width="15%">快递寄送凭证</td>
                            <td> <div class="openBox action-ajax-load" data-url="<@url value='/archive/rest/v1/fileDiv?loanapplyNo=${loanapplyNo}&loanId=${loanId}&datalistType=FASTFREIGHT_PRO'/>" id="file_uploader"> </div></td>
                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>快递时间</td>
                            <td colspan="3">
								<@date value="${provinceRecord.sendTime}" id="archiveSendTime" name="sendTime"  data\-action\-valid\-rule="required;"/>
							    <span class="action-field-error" for="loanDate" style="color:red;"></span>
							</td>
                        </tr>
                        <tr>
                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>快递公司</td>
                            <td> <input id="archiveSendCompany" name="sendCompany" type="text" value="${provinceRecord.sendCompany}" /></td>
                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>快递单号</td>
                            <td colspan="3"> <input id="archiveSendNo" name="sendNo" type="text" value="${provinceRecord.sendNo}" /></td>
                        </tr>
                    </tbody>
                </table> 
            </div>
            
            
            <input name="loanapplyNo" type="hidden" value="${loanapplyNo}"/>
            <input name="bankTypeId" type="hidden" value="${bankTypeId}"/>
            <input name="formTypeId" type="hidden" value="${formTypeId}"/>
            <input id="contentJsonInpu" name="contentJson" type="hidden"/>
            </form>
    </div>
  <div class=" mtb20 tac">
  	<span id="archiveErrorMsg" style="disploy:none;" class="red"></span></br>
  	<a id="saveArchiveRecordBtn" href="#" class="btn_auto_30 btn_blue">保 存</a>
  	<c:if test="${isSave == 'show'}">
  		<a href="javascript:void();" data-url="<@url value='/archive/rest/v1/print?type=province&loanapplyNo=${loanapplyNo}&bankTypeId=${bankTypeId}'/>" class="action-ajax-btn btn_auto_30 btn_blue">打印</a>
    </c:if>
  </div>
<@js>
	$('#platformDiv select').attr('disabled','disabled');
	$('#platformDiv input').attr('disabled','disabled');
	$("#saveArchiveRecordBtn").click(function(){
		if(!$('#archiveRecordForm .jqUploadFile').length){
			$('#archiveErrorMsg').text('快递寄送凭证不能为空！').show();
			return;
		}
		if(!$('#archiveSendTime').val()){
			$('#archiveErrorMsg').text('快递时间不能为空！').show();
			return;
		}
		if(!$('#archiveSendCompany').val()){
			$('#archiveErrorMsg').text('快递公司不能为空！').show();
			return;
		}
		if(!$('#archiveSendNo').val()){
			$('#archiveErrorMsg').text('快递单号不能为空！').show();
			return;
		}
		var checkSelect=1;
		var errorMsg="";
		var contentJson={};
		$('#archiveRecordForm table').find('.fieldVaule').each(function(f,field){
			var key=$(field).attr('data');
			var value=$(field).find('select').val();
			contentJson[key]=value;
			if(value=="请选择"){
				checkSelect=0;
				errorMsg=key+"不能为空!";
				return false;
			}
		});
		if(!checkSelect){
			$('#archiveErrorMsg').text(errorMsg).show();
			return;
		}
		$('#archiveErrorMsg').text('').hide();
		$('#contentJsonInpu').val(JSON.stringify(contentJson));
		$('#archiveRecordForm').submit();
   });
</@js>
<@jsRender/>